Skip to content

fix: exclude Poetry dev dependencies from SBOMs#479

Merged
Strum355 merged 1 commit into
guacsec:mainfrom
Strum355:TC-4096
Apr 21, 2026
Merged

fix: exclude Poetry dev dependencies from SBOMs#479
Strum355 merged 1 commit into
guacsec:mainfrom
Strum355:TC-4096

Conversation

@Strum355

@Strum355 Strum355 commented Apr 17, 2026

Copy link
Copy Markdown
Member

Summary

  • Poetry's show --tree command returns all dependency groups including dev, causing dev-only packages (e.g. black, pytest) to appear in vulnerability scans as false positives
  • Fix checks the parsed pyproject.toml for dev group declarations ([tool.poetry.group.dev.dependencies] or [tool.poetry.dev-dependencies]) and passes --without dev to poetry show --tree when present
  • Adds test fixtures and tests for both the modern (Poetry 1.2+) and legacy dev dependency formats

Resolves TC-4096

Test plan

  • Reproduced the bug locally: black (dev dep) appeared in SBOM before fix
  • Verified fix excludes dev deps from both stack and component analysis
  • Verified both modern ([tool.poetry.group.dev.dependencies]) and legacy ([tool.poetry.dev-dependencies]) formats are handled
  • Verified projects without a dev group still work (no --without dev flag passed)
  • Verified custom non-dev groups are preserved (only dev is excluded)
  • All 35 pyproject tests pass, no regressions

🤖 Generated with Claude Code

@ruromero

ruromero commented Apr 20, 2026

Copy link
Copy Markdown
Collaborator

/review

@ruromero ruromero left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Strum355
Strum355 merged commit 6ca858a into guacsec:main Apr 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants